<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/mesog/oginfos/Oginfo.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/mesog/oginfos/Oginfo.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'id',
                footer: "Foots",
                cnName: '外协明细表',
                name: 'oginfos/Oginfo',
                url: "/Oginfo/",
                sortName: " id"
            });
            const editFormFields = ref({});
            const editFormOptions = ref([]);
            const searchFormFields = ref({"outsourcing_unit":"","outsourcing_number":"","product_name":"","status":"","outsourcing_process":""});
            const searchFormOptions = ref([[{"title":"外协单位","field":"outsourcing_unit"},{"title":"外协编号","field":"outsourcing_number"},{"title":"产品名称","field":"product_name"},{"dataKey":"生产状态","data":[],"title":"状态","field":"status","type":"select"},{"title":"外协工序","field":"outsourcing_process"}]]);
            const columns = ref([{field:'outsourcing_unit',title:'外协单位',type:'string',width:220,align:'left',sort:true},
                       {field:'outsourcing_number',title:'外协编号',type:'string',width:220,align:'left'},
                       {field:'product_name',title:'产品名称',type:'string',width:220,align:'left'},
                       {field:'status',title:'状态',type:'string',bind:{ key:'生产状态',data:[]},width:220,align:'left'},
                       {field:'outsourcing_process',title:'外协工序',type:'string',width:220,align:'left'},
                       {field:'quantity',title:'数量',type:'int',width:110,align:'left'},
                       {field:'rmb_unit_price',title:'人民币单价',type:'decimal',width:110,align:'left'},
                       {field:'rmb_total_price',title:'人民币总价',type:'decimal',width:110,align:'left'},
                       {field:'currency',title:'币别',type:'string',width:220,align:'left'},
                       {field:'original_currency_unit_price',title:'原币单价',type:'decimal',width:110,align:'left'},
                       {field:'original_currency_total_price',title:'原币总价',type:'decimal',width:110,align:'left'},
                       {field:'expected_completion_date',title:'预计完成日期',type:'datetime',width:150,align:'left',sort:true},
                       {field:'shipped_quantity',title:'发货数',type:'int',width:110,align:'left'},
                       {field:'received_quantity',title:'收货数',type:'int',width:110,align:'left'},
                       {field:'unreceived_quantity',title:'未收货数',type:'int',width:110,align:'left'},
                       {field:'non_conforming_quantity',title:'不合格数',type:'int',width:110,align:'left'},
                       {field:'receipt_date',title:'收货日期',type:'datetime',width:150,align:'left',sort:true},
                       {field:'overdue_days',title:'逾期天数',type:'int',width:110,align:'left'},
                       {field:'remaining_days',title:'剩余天数',type:'int',width:110,align:'left'},
                       {field:'creation_time',title:'创建时间',type:'datetime',width:150,require:true,align:'left',sort:true}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
